<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Lista de Chamados</title>
<link rel="stylesheet" type="text/css" media="screen" href="../css/vader/jquery-ui.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../css/ui.jqgrid.css" />

<script src="../js/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="../js/jquery-ui-1.10.3.custom.js"></script>
<script src="../js/jquery.jqGrid.src.js" type="text/javascript"></script>
<script src="../js/i18n/grid.locale-pt-br.js" type="text/javascript"></script>

<script type="text/javascript">
	$(function(){
		jQuery('#list1').jqGrid({
			url:"listChamados.php",
			datatype:'json',
			mtype: 'GET',
			colNames:['ID','Solicitante','E-Mail','Data Abertura','Sistema','Horas Consumidas','Status'],
			colModel:[
				{name:'chamado.id',index:'chamado.id',width:40,formatter:'showlink',formatoptions:{
					baseLinkUrl:'formListaInteracoes.php',
				}},
				{name:'chamado.solicitante',index:'chamado.solicitante',width:120},
				{name:'chamado.email',index:'chamado.email',width:120},
				{name:'chamado.dataAbertura',index:'chamado.dataAbertura',width:140},
				{name:'sistema.nome',index:'sistema.nome',width:100},
				{name:'chamado.horasConsumidas',index:'chamado.horasConsumidas',width:100},
				{name:'ch_status.nome',index:'ch_status.nome',width:100}
			],
			rowNum:10,
			rowList:[10,20,30],
			pager: '#pager1',
			sortname:'id',
			viewrecords: true,
			sortorder:"asc",
			caption:"Lista de Chamados"
		});	
		jQuery('#list1').jqGrid('navGrid','#pager1',{edit:false,add:false,del:false});
	});
</script>
</head>

<body>
	<table id="list1" name="list1"></table>
	<div id="pager1" name="pager1"></div>
    <div><a href="formAbrirChamado.php">Abrir novo chamado</a></div>
</body>
</html>